package com.javaee.rmi.demo;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;

/** 运行服务器前先要启动RMI注册服务器(命令:rmiregistry启动RMI服务,默认端口1099)*/
public class RmiServer {

	public static void main(String[] args) {
		
		try {
			
			RemoteStudentImpl stu = new RemoteStudentImpl();
			Naming.rebind("student", stu);

		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} 
		
	}

}
